package com.ourfox.commons.datasource;

/**
 * 
 * <p>Title: DataSourceContextHolder.java</p>
 * <p>Description: TODO(用一句话描述该文件做什么)</p>
 * <p>Company: ourfox</p>
 *
 * @author luoxiujin<xiujin.luo@gmail.com>  
 * @version V1.0
 * @date 2011-10-13 下午8:36:52
 *
 */
public class DataSourceContextHolder {

	private static final ThreadLocal<String> contextHolder = new ThreadLocal<String>(); // 线程本地环境

	// 设置数据源类型
	public static void setDataSourceType(String dataSourceType) {
		contextHolder.set(dataSourceType);
	}

	// 获取数据源类型
	public static String getDataSourceType() {
		return (String) contextHolder.get();
	}

	// 清除数据源类型
	public static void clearDataSourceType() {
		contextHolder.remove();
	}
}
